package com.yqd.lesson.actor.one

import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import com.yqd.lesson.actor.one.Receiver.Greeting


object Sender{
  def props(printerActor: ActorRef): Props = Props(new Sender(printerActor))
}

class Sender(printerActor: ActorRef) extends Actor with ActorLogging{

  override def receive: Receive = {
    case msg:String =>{
      printerActor ! Greeting(msg);
    }
  }
}
